using System;
using System.Collections.Generic;

namespace SolarWinds.Logic
{
    public class Team
    {
        private String mName = "";
        private readonly List<Player> mPlayers = new List<Player>();

        public int TeamScore { get; set; }

        public Team(String name)
        {
            mName = name;
        }

        public String Name
        {
            get
            {
                return mName;
            }
            set
            {
                mName = value;
            }
        }

        public List<Player> GetPlayers()
        {
            return mPlayers;
        }

        public void AddPlayer(Player player)
        {
            player.PlayerNumber = NumberOfPlayers() + 1;

            mPlayers.Add(player);
        }

        public void RemovePlayer(int playerNumber)
        {
            mPlayers.RemoveAt(playerNumber);
        }

        public int NumberOfPlayers()
        {
            return mPlayers.Count;
        }
    }
}